package com.zygh.policeasset.mapper;

import com.zygh.policeasset.pojo.Witbig;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.type.JdbcType;

@Mapper
/* loaded from: police-asset-2.0-0.0.1-SNAPSHOT.jar:BOOT-INF/classes/com/zygh/policeasset/mapper/WitbigMapper.class */
public interface WitbigMapper {
    @Delete({"delete from witbig where id = #{id,jdbcType=INTEGER}"})
    int deleteById(Integer num);

    @Insert({"insert into witbig (type, witbig_num, witbig_name) ", "values (#{type,jdbcType=VARCHAR}, #{witbigNum,jdbcType=VARCHAR}, #{witbigName,jdbcType=VARCHAR})"})
    int add(Witbig witbig);

    @Select({"<script>", "select id, type, witbig_num, witbig_name from witbig <where> <if test='type != null and type.length &gt; 0 '>type = #{type,jdbcType=VARCHAR}</if></where> </script>"})
    @Results(id = "map", value = {@Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER, id = true), @Result(column = "type", property = "type", jdbcType = JdbcType.VARCHAR), @Result(column = "witbig_num", property = "witbigNum", jdbcType = JdbcType.VARCHAR), @Result(column = "witbig_name", property = "witbigName", jdbcType = JdbcType.VARCHAR)})
    List<Witbig> findAll(String str);

    @Update({"update witbig set witbig_name = #{witbigName,jdbcType=VARCHAR} ", "where id = #{id,jdbcType=INTEGER}"})
    int updateById(Witbig witbig);

    @Select({"select witbig_num from witbig where witbig_name = #{witbigName,jdbcType=VARCHAR} and type = #{type,jdbcType=VARCHAR}"})
    @Results({@Result(column = "witbig_num", property = "witbigNum", jdbcType = JdbcType.VARCHAR)})
    String findOneByName(@Param("type") String str, @Param("witbigName") String str2);

    @Select({"select witbig_name from witbig where witbig_num = #{witbigNum,jdbcType=VARCHAR} and type = #{type,jdbcType=VARCHAR}"})
    @Results({@Result(column = "witbig_name", property = "witbigName", jdbcType = JdbcType.VARCHAR)})
    String findOneByNum(@Param("type") String str, @Param("witbigNum") String str2);

    @ResultMap({"map"})
    @Select({"select * from witbig where id = #{id} "})
    Witbig findById(@Param("id") Integer num);

    @Select({"select count(*) from witbig where type = #{type} and witbig_name = #{witbigName}"})
    Integer findCount(@Param("type") String str, @Param("witbigName") String str2);
}